
<include file="./Application/Admin/View/_meta.html" />
<include file="./Application/Admin/View/_header.html" />
<include file="./Application/Admin/View/_menu.html" />

<style>
    .Huiform{
        overflow: hidden;
        z-index: 100;
        position: fixed;
        left: 0;

    }
</style>
<section class="Hui-article-box">
    <!--<div class="text-c" style="margin-top: 20px;"> -->
    <div class="text-c" style="margin-top: 20px;">
        <form class="Huiform" method="get" action="{:U('Transaction/Index')}">
            按订单号搜索：<input type="text"  placeholder="按订单号搜索" value="<?php echo I('get.order_number'); ?>" name="order_number" class="input-text"  style="width:150px" >

        按支付通道搜索：
            <span class="select-box inline">
                <select name="passageway" class="select">
                    <option value="">全部</option>
                     <foreach name="pay_passagewayS" item="pay_passageway">
                        <option <?php if($passageway[0] == $pay_passageway['pay_methodname'] && $passageway[1] == $pay_passageway['pay_type']) echo 'selected="selected"'; ?> value="{$pay_passageway.pay_methodname}@{$pay_passageway.pay_type}">{$pay_passageway.asname}({$pay_passageway.name})</option>
                     </foreach>
                </select>
				</span>

            按订单状态搜索：
            <span class="select-box inline">
                <select name="order_status" class="select">
                     <option value="">全部</option>
                    <option value="1" <?php if($_GET['order_status'] == "1") echo 'selected="selected"'; ?>>成功</option>
                    <option value="0" <?php if($_GET['order_status'] == "0") echo 'selected="selected"'; ?>>失败</option>
                </select>
				</span>

            按日期搜索：<input type="text" onfocus="fncheck('kaishi'); " name="startTime" id="datemin" class="input-text Wdate" style="width:150px;">
            -
            <input type="text" onfocus="fncheck('jieshu');" id="datemax" name="EndTime" class="input-text Wdate" style="width:150px;">
            按金额搜索：<input type="number"  placeholder="金额搜索" value="<?php echo I('get.price'); ?>" name="price" class="input-text"  style="width:80px" >

            按平台搜索：
            <span class="select-box inline">
                     <select name="merchant_id" class="select">
                            <option value="">全部</option>
                            <foreach name="platforms" item="platform" >
                                <option value="{$platform.merchant_id}" <?php if($_GET['merchant_id'] == $platform['merchant_id']) echo 'selected="selected"'; ?> >{$platform.userremarks}</option>
                            </foreach>
                    </select>
            </span>

            按支付类型搜索：
            <span class="select-box inline">
                     <select name="pay_type" class="select">
                            <option value="">全部</option>
                            <option value="WeixinScancode" <?php if($_GET['pay_type'] == "WeixinScancode") echo 'selected="selected"'; ?>>微信扫码支付</option>
                            <option value="weixinGzh_pay" <?php if($_GET['pay_type'] == "weixinGzh_pay") echo 'selected="selected"'; ?>>微信公众号支付</option>
                            <option value="alipay_pay" <?php if($_GET['pay_type'] == "alipay_pay") echo 'selected="selected"'; ?>>支付宝支付</option>
                            <option value="qq_pay" <?php if($_GET['pay_type'] == "qq_pay") echo 'selected="selected"'; ?>>QQ支付</option>
                            <option value="jd_pay" <?php if($_GET['pay_type'] == "jd_pay") echo 'selected="selected"'; ?>>京东钱包支付</option>
                            <option value="bank_pay" <?php if($_GET['pay_type'] == "bank_pay") echo 'selected="selected"'; ?>>网银支付</option>
                    </select>
            </span>

            <button type="submit" class="btn btn-success"><i class="Hui-iconfont">&#xe600;</i> 搜索</button>
        </form>
    </div>
    <div class="Hui-article">
        <style type="text/css">
            .cl pd-20{

            }
        </style>
        <article class="cl pd-20" style="margin-top: 25px;">
            <div class="mt-20">
                <table class="table table-border table-bordered table-bg table-hover table-sort">
                    <thead>
                    <tr class="text-c">
                        <th width="50">ID</th>
                        <th width="180">游戏订单号</th>
                        <th width="110">所属游戏平台</th>
                        <th>系统订单号</th>
                        <th>订单金额</th>
                        <th>商户ID号</th>
                        <th>支付类型</th>
                        <th>支付状态</th>
                        <th width="120">成功时间</th>
                        <th width="120">补发通知</th>
                    </tr>
                    </thead>
                    <tbody>
                <foreach name="datas" item="datasS">
                    <tr class="text-c">
                        <td>{$datasS.id}</td>
                        <td>{$datasS.out_trade_no}</td>
                        <td>{$datasS.gamaname}</td>
                        <td>{$datasS.systrade_no}</td>
                        <td>{$datasS.paymoney}</td>
                        <td>{$datasS.merchant}</td>
                        <td>{$datasS.pay_type}</td>
                        <td>
                            <if condition="$datasS.pay_status eq '0'">
                                <span class="label label-warning radius">失败</span>
                                <else />
                                <span class="label label-success radius">成功</span>
                            </if>
                        </td>
                        <td>
                            <if condition="$datasS.pay_status neq '0'">
                                <?php echo date('Y-m-d H:i:s',$datasS['update_begtime']); ?>
                            </if>

                        </td>

                        <td>
                            <if condition="$datasS.pay_status neq '0'">
                                <button onclick="repeat('{$datasS.out_trade_no}')"  class="btn btn-primary radius" type="submit"><i class="Hui-iconfont"></i> 补发通知</button>
                            </if>
                        </td>
                        <!--<td class="td-status"><span class="label label-success radius">已发布</span></td>-->
                    </tr>
                </foreach>
                    </tbody>
                </table>
                <div class="dataTables_wrapper">
                    <!--<div class="dataTables_info" id="DataTables_Table_0_info" role="status" aria-live="polite">显示 1 到 1 ，共 1 条</div>-->
                    <div class="dataTables_paginate paging_simple_numbers" id="DataTables_Table_0_paginate">
                        <!--<a class="paginate_button previous disabled" aria-controls="DataTables_Table_0" data-dt-idx="0" tabindex="0" id="DataTables_Table_0_previous">%first%</a>-->
                        <!--<span><a class="paginate_button current" aria-controls="DataTables_Table_0" data-dt-idx="1" tabindex="0">%current%</a></span>-->
                        <!--<a class="paginate_button next disabled" aria-controls="DataTables_Table_0" data-dt-idx="2" tabindex="0" id="DataTables_Table_0_next">%upPage%</a>-->
                        {$page}
                    </div>
                </div>
            </div>
        </article>
    </div>
</section>

<include file="./Application/Admin/View/_footer.html" />

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="__ADMIN__/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="__ADMIN__/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="__ADMIN__/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript">
    function repeat(order_number){
//        layer.alert(order_number);
        $.ajax({
            'url' : '{:U("repCallback")}',
            'type' : 'post',
            dataType: "json",
            'data' : {
                "order_number" : order_number
            },
            success : function (data) {
                if(data.code == 3) {
                    layer.alert('补单成功，成功订单号：' + order_number);
                }else{
                    layer.alert(data.msg);
                }
            }
        });
    }

    function fncheck(b) {
        if(b == 'kaishi'){
            WdatePicker({maxDate:$('#datemax').val(),dateFmt:'yyyy-MM-dd HH:mm:ss'})
            //WdatePicker({minDate:$('#timeStart').val()})
        }

        if(b == 'jieshu'){
            console.log(2);
            WdatePicker({minDate:$('#datemin').val(),dateFmt:'yyyy-MM-dd HH:mm:ss'})
        }
    }
</script>
</body>
</html>